package laf.socf.simulator;

import org.freedesktop.dbus.DBusConnection;
import org.freedesktop.dbus.DBusInterface;

/**
 *
 * @author laf
 */
public class SensorServer {

    private static SensorServer instance = null;
    private DBusConnection conn = null;

    private SensorServer() throws Exception {
        conn = DBusConnection.getConnection(DBusConnection.SESSION);
        conn.requestBusName("socf.simulator");
    }

    public static SensorServer getInstance() throws Exception {
        if (instance == null) {
            instance = new SensorServer();
        }
        return instance;
    }

    public void exportObject(String objectPath, DBusInterface object) throws Exception {
        this.conn.exportObject(objectPath, object);
    }

}
